#include "MyGenContainer.hh"

void MyGenContainer::Config(YAML::Node yamlNode)
{
    m_Config = yamlNode;
    m_MyPosType = m_Config["PosType"].as<std::string>("PosPointSource");
    m_MyPosPtr = (MyBasePos*)MyPosCreator::GetInstance().CreateNewMyPos(m_MyPosType);

    m_MyGenType = m_Config["GenType"].as<std::string>("SimpleParticleGun");
    m_MyGenPtr = (MyBaseGen*)MyGenCreator::GetInstance().CreateNewMyGen(m_MyGenType);
}

void MyGenContainer::Initialize()
{
    m_MyPosPtr->Initialize(m_Config[m_MyPosType]);
    m_MyGenPtr->Initialize(m_Config[m_MyGenType]);
}